<html>

<head>
    <meta charset="utf-8">
    <title>添加商品</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="format-detection" content="telephone=no">
    <link rel="stylesheet" href="/shop/static/layui/css/layui.css" media="all" type="text/css">
    <link rel="stylesheet" href="/shop/static/css/public.css" media="all" type="text/css"> </head>

<body class="childrenBody">
<fieldset class="layui-elem-field layui-field-title" style="margin-top: 30px;">
  <legend>常规轮播</legend>
</fieldset>  
        <div>
            <input type="hidden" name="id" id="id" value="0">
            <div style="padding: 20px; background-color: #F2F2F2;">
                <div class="layui-row layui-col-space15">
                    <div class="layui-col-md6">
                        <div class="layui-card">
                            <div class="layui-card-header">
                                 		默认样式
                            </div>
                            <div class="layui-card-body">
                            		<div class="shop-show-img" style="background:url(http://up.yloveg.com/upload/img/1812/14/20181214091817640.jpeg);background-repeat:no-repeat; background-size:100% 100%;-moz-background-size:100% 100%;">
                            			<a class="overlay lightbox"> <button name="1" class="layui-btn layui-btn-warm layui-btn-radius center"><#if shopInfo ??><#if shopInfo.shopStyle=="1"><i class="layui-icon">&#xe627;</i>已选择<#else><i class="layui-icon">&#xe626;</i>选择</#if><#else><i class="layui-icon">&#xe626;</i>选择</#if></button></a>
                            		</div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    <script src="/shop/static/layui/layui.js" charset="utf-8" type="text/javascript"></script>
    <script type="text/javascript" src="/shop/static/js/common/jquery-2.1.0.min.js"></script>
    <script type="text/javascript" charset="utf-8" src="/shop/static/js/common/ajaxfileupload.js"></script>    
    <script type="text/javascript">   
    $(".shop-show-img").hover(function(){
    	$(this).children("a").show()
	},function(){
		$(this).children("a").hide()
	});
    layui.use(['form'], function() {
        var form = layui.form,
            layer = layui.layer;

        $(".center").click(function(){
        	debugger;
        	var id = this.name;
            layer.confirm('确认选择这个吗？', {title:'提示'}, function(index){
                $.ajax({
                    cache: true,
                    type: "POST",
                    url: "/shop/shops/saveStyle",
                    data: {"styleId" : id},
                    async: false,
                    error: function(request) {
                        layer.msg('系统错误！');
                    },
                    success: function(data) {
                        if(data.code == "1") {
                            layer.msg(data.msg, {
                                time: 1000
                            }, function() { //提示框设定显示1秒
                            	location.reload(); 
                            })
                        } else {
                            layer.msg(data.msg);
                        }
                    }
                });
          	});
    	})
    });

    </script>
</body>

</html>